From 9e464252c02e65425179d6c583c76d5685880ba4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20=C3=85dahl?= Date: Fri, 5 Jun 2015 13:35:21 +0800 Subject: [PATCH] wayland: Don't try to guess the popup menu placement when it was set If a position was already explicitly set, don't try to guess the position of popup menus by looking at the pointer position, just use the set coordinates. https://bugzilla.gnome.org/show_bug.cgi?id=748951 --- gdk/wayland/gdkwindow-wayland.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 19d92244dd..590ff4d8c1 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -108,6 +108,7 @@ struct _GdkWindowImplWayland unsigned int use_custom_surface : 1; unsigned int pending_commit : 1; unsigned int awaiting_frame : 1; + unsigned int position_set : 1; GdkWindowTypeHint hint; GdkWindow *transient_for; @@ -1190,10 +1191,13 @@ gdk_wayland_window_map (GdkWindow *window) transient_for = gdk_device_get_window_at_position (impl->grab_device, NULL, NULL); transient_for = gdk_window_get_toplevel (transient_for); - /* start the popup at the position of the device that holds the grab */ - gdk_window_get_device_position (transient_for, - impl->grab_device, - &window->x, &window->y, NULL); + /* If the position was not explicitly set, start the popup at the + * position of the device that holds the grab. + */ + if (!impl->position_set) + gdk_window_get_device_position (transient_for, + impl->grab_device, + &window->x, &window->y, NULL); } else transient_for = impl->transient_for; @@ -1412,6 +1416,7 @@ gdk_window_wayland_move_resize (GdkWindow *window, { window->x = x; window->y = y; + impl->position_set = 1; if (impl->subsurface) { -- 2.30.2